﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using HF.WorkFlow.DataContract;
using System.Data;
namespace HF.WCF.WFInterface
{
    [ServiceContract]
    public  interface IArchitectureService
    {
        /// <summary>
        /// 读取组织机构下的所有人
        /// </summary>
        /// <param name="architectureId">组织机构Id</param>
        /// <returns>返回组织机构所有用户<returns>
        [OperationContract]
        List<UserEntity> GetUserEntitys(string architectureId);
        /// <summary>
        ///  根据UserId列出用户所隶属的所有部门
        /// </summary>
        /// <param name="userId">UserId</param>
        /// <returns>数据实体</returns>
        [OperationContract]
         List<ArchitectureEntity> GetDepartmentEntitysOfUser(string userId);
         /// <summary>
        /// 获取所有组织机构中的部门
        /// </summary>
        /// <returns>部门信息</returns>
        [OperationContract]
         List<ArchitectureEntity> GetAllDepartmentEntitys();
        /// <summary>
        /// 获得组织机构的所有子机构,包括岗位，部门
        /// </summary>
        /// <param name="fatherId">父组织机构Id</param>
        /// <returns>子组织机构数据实体</returns>
        [OperationContract]
         List<ArchitectureEntity> GetChildArchitectureEntitys(string architectureId);
         /// <summary>
        /// 获得下级部门列表
        /// </summary>
        /// <param name="fatherArcheId">机构Id</param>
        /// <returns>下级部门实体</returns>
        [OperationContract]
         List<ArchitectureEntity> GetChildDepartmentEntitys(string architectureId);
         /// <summary>
        /// 获得部门下的所有岗位
        /// </summary>
        /// <param name="architectureId">组织机构Id</param>
        /// <returns>岗位实体</returns>
        [OperationContract]
         List<ArchitectureEntity> GetDutyEntitys(string architectureId);
        /// <summary>
        /// 获得本部门下的所有主管岗位
        /// </summary>
        /// <param name="FatherClassId">组织机构Id</param>
        /// <returns>岗位实体</returns>
        [OperationContract]
         List<ArchitectureEntity> GetLeaderEntitys(string architectureId);
         /// <summary>
        /// 获取上级机构Id
        /// </summary>
        /// <param name="ArchitectureId">组织机构Id</param>
        /// <returns>上级组织机构Id</returns>
         [OperationContract]
         string GetFatherId(string architectureId);
          /// <summary>
        ///  把一个用户添加到组织机构中。
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="architectureId">组织机构Id</param>
         [OperationContract]
         void MoveUserIntoArchitecture(string userId, string architectureId);
        /// <summary>
        ///  删除用户隶属的所有组织关系
        /// </summary>
        /// <param name="userId">用户Id</param>
         [OperationContract]
          void RemoveAllArchitectures(string userId);
         /// <summary>
        ///  移除组织机构下的一个用户
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="architectureId">组织机构Id</param>
         [OperationContract]
          void RemoveUser(string userId, string architectureId);
        /// <summary>
        /// 移除组织机构下的所有用户
        /// </summary>
        /// <param name="architectureId">组织机构Id</param>
         [OperationContract]
          void RemoveAllUsers(string architectureId);
         /// <summary>
        /// 获得用户上级部门
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns>上级部门Entiys</returns>
         [OperationContract]
          List<ArchitectureEntity> GetHighDepartmentEntitysOfUser(string userId);
        /// <summary>
        /// 获得用户下级部门
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns>下级部门Entitys</returns>
         [OperationContract]
          List<ArchitectureEntity> GetLowerDepartmentEntitysOfUser(string userId);
        /// <summary>
        /// 判断该组织机构是否存在
        /// </summary>
        /// <param name="ArchId">组织机构id</param>
        /// <returns>true/false</returns>
         [OperationContract]
         bool Exists(string architectureId);
        /// <summary>
        /// 获得一个组织结构类的实体
        /// </summary>
        /// <param name="architectureId">组织机构Id</param>
        /// /// <returns>Entity</returns>
         [OperationContract]
         ArchitectureEntity GetArchitectureEntity(string architectureId);
        /// <summary>
       /// 增加一个组织机构
       /// </summary>
       /// <param name="entity">组织机构实体</param>
       /// <returns>影响的行数</returns>
         [OperationContract]
         int Insert(ArchitectureEntity entity);
         /// <summary>
        /// 更新一个组织机构
        /// </summary>
        /// <param name="entity">组织机构实体</param>
        /// <returns>影响的行数</returns>
         [OperationContract]
         int Update(ArchitectureEntity entity);
         /// <summary>
        /// 删除一个组织机构
        /// </summary>
        /// <param name="architectureId">组织机构Id</param>
         [OperationContract]
         int Delete(string architectureId);
        /// <summary>
        /// 获取一个岗位  
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
         [OperationContract]
         DataTable GetArchitecturesOfUser(string userId);    //zhuyun 
    }
}
